#include <iostream>
using namespace std;

int main()
{
	int n = 0;
	cin >> n;
	int i = 0;
	while (n)
	{
		i += n % 10;
		n /= 10;
	}
	cout << i;
	return 0;
}
